package com.yl.widget;

import com.yl.order.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

public class MenuBar extends LinearLayout{
	
	private Context mContext = null; 
	private MenuItem mMyMenu = null;
	private MenuItem mQuickSearch = null;
	private MenuItem mSmartOrder = null;
	private MenuItem mSetting = null;
	private MenuItem mBillboard = null;
	private MenuItem mFun = null;
	
	public MenuBar(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}
	
	public MenuBar(Context context) {
		super(context);
		init(context);
	}
	
	private void init(Context c) {
		mContext = c;
		LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.menu_bar, this);
		
		mMyMenu = (MenuItem)findViewById(R.id.menu_item_my_menu);
		if (mMyMenu != null) {
			mMyMenu.setText(R.string.button_my_menu);
		}
		
		mQuickSearch = (MenuItem)findViewById(R.id.menu_item_quick_search);
		if (mQuickSearch != null) {
			mQuickSearch.setText(R.string.button_quick_search);
		}
		
		mSmartOrder = (MenuItem)findViewById(R.id.menu_item_smart_order);
		if (mSmartOrder != null) {
			mSmartOrder.setText(R.string.button_smart_order);
		}
		
		mSetting = (MenuItem)findViewById(R.id.menu_item_setting);
		if (mSetting != null) {
			mSetting.setText(R.string.button_setting);
		}
		
		mBillboard = (MenuItem)findViewById(R.id.menu_item_billboard);
		if (mBillboard != null) {
			mBillboard.setText(R.string.button_billboard);
		}
		
		mFun = (MenuItem)findViewById(R.id.menu_item_fun);
		if (mFun != null) {
			mFun.setText(R.string.button_fun);
		}
	}

}
